package com.morehair.controller.wx;

import com.morehair.bean.pojo.Region;
import com.morehair.bean.vo.admin.BaseRespVo;
import com.morehair.bean.vo.wx.RegionListVo;
import com.morehair.service.wx.WxRegionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@Transactional
public class WxRegionControllor {

    @Autowired
    WxRegionService regionService;
    @RequestMapping("wx/region/list")
    public BaseRespVo listRegion(int pid){
        List<Region> regions = regionService.getRegionList(pid);
        return BaseRespVo.ok(regions);
    }
}
